<?php /* Smarty version 2.6.26, created on 2013-04-07 09:44:43
         compiled from ../templates/item_alertopen.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'U', '../templates/item_alertopen.html', 35, false),)), $this); ?>
<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>コントロールパネル</title>

    <link href="./assets/styles/default.css" rel="stylesheet" />
	<script src="./assets/scripts/libs/jquery-1.7.1.min.js" type="text/javascript"></script>
	<script src="./assets/scripts/import.js" type="text/javascript"></script>
       		<script type="text/javascript">
		$(function() {
			$('.message').fadeIn("slow");
			$('.text_date').datepicker({
				changeMonth: true,
				changeYear: true,
				dateFormat: 'yy/mm/dd'
			});
			$('#btn-export').click(function(){	
				if(confirm('ダウンロードしますか？')){
					document.form1.csv.value="download";
					document.form1.submit();
					
				}
			});
			$('#btn-reset').click(function(){	
				location.href = document.form1.action;
			});
			
			$('#btn_search').click(function(){	
				document.form1.csv.value="";
				document.form1.submit();
			});

			$('#btn_single_c').click(function(){	
				location.href ="<?php echo ((is_array($_tmp='Home/Item/insert')) ? $this->_run_mod_handler('U', true, $_tmp) : U($_tmp)); ?>
";
			});
		});
	
		function toPage(thepage) {
			document.form1.page.value =  thepage;
			document.form1.csv.value="";
			document.form1.submit();
		}
		

function CopyPath(FilePath,id)
{
	
	
  //  var str=location.toString();
    var Result='<?php echo $this->_tpl_vars['result']; ?>
';
    var Result_id='<?php echo $this->_tpl_vars['result']; ?>
_id';
   
    window.opener.document.getElementById(Result).value = FilePath;
    window.opener.document.getElementById(Result_id).value = id;	
	//window.opener.document.fm(Result).value=FilePath;
   window.opener=null;
    window.close();
}

</script>
</head>
<body>
	
 <section id="content">

        	<h3>商品検索</h3>
			<div id="search_form">
				<form name="form1" id="form1" method="get" action="<?php echo ((is_array($_tmp='Home/item/searchopen')) ? $this->_run_mod_handler('U', true, $_tmp) : U($_tmp)); ?>
">
					<input type="hidden" name="page" />
					<dl>
						<dt>フリーワード</dt>
						<dd>
							<input type="text" name="free_word" value="<?php echo $this->_tpl_vars['forms']['free_word']; ?>
" />
						</dd>
					</dl>
					<dl>
						<dt>状態</dt>
						<dd>
					    <?php $_from = $this->_tpl_vars['goods_status']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['member'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['member']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['kk'] => $this->_tpl_vars['vv']):
        $this->_foreach['member']['iteration']++;
?>
					   		<?php $this->assign('goods_statu', "goods_statu".($this->_tpl_vars['kk'])); ?>
							<label><input type="checkbox" name="goods_statu<?php echo $this->_tpl_vars['kk']; ?>
"  <?php if ($this->_tpl_vars['forms'][$this->_tpl_vars['goods_statu']] == $this->_tpl_vars['kk']): ?> checked="true" <?php endif; ?> value="<?php echo $this->_tpl_vars['kk']; ?>
" /><?php echo $this->_tpl_vars['vv']; ?>
</label>
						<?php endforeach; endif; unset($_from); ?>
						</dd>
					</dl>
					<dl>
						<dt>更新日時</dt>
						<dd>
							<input type="text" name="data1" class="text_date" value="<?php echo $this->_tpl_vars['forms']['data1']; ?>
" /> ～
							<input type="text" name="data2" class="text_date" value="<?php echo $this->_tpl_vars['forms']['data2']; ?>
" />
						</dd>
					</dl>
					<dl class="category clear">
						<dt>カテゴリー</dt>
						<dd>
							<p class="btn_blank float-left btn_category" id="id_category">
								<a href="javascript:;">カテゴリ選択</a>
							</p>
							<ul id="search_category" class="float-left">
							</ul>
						</dd>
					</dl>
					<p class="search_submit">
						<button type="submit" class="submit"><span>検索</span></button>
					</p>
				<INPUT type='hidden' name='result' value='<?php echo $this->_tpl_vars['result']; ?>
'/>
			    <input type="hidden" name="search" value="1" />
				<input type="hidden" name="csv" />
				</form>
			</div>
<?php if (! $this->_tpl_vars['is_showlist']): ?>
			<p class="message"><?php if ($this->_tpl_vars['page']['cnt'] > 0): ?><?php echo $this->_tpl_vars['page']['cnt']; ?>
件登録されています。<?php else: ?>見つかりませんでした。<?php endif; ?></p>

			<?php echo $this->_tpl_vars['result']; ?>


			<table id="search_result" class="sortable">
				<thead>
					<tr>
						<th>コード</th>
						<th width="64">画像</th>
						<th>商品名</th>
						<th>価格</th>
						
					
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
								<?php $_from = $this->_tpl_vars['data']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['member'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['member']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['v']):
        $this->_foreach['member']['iteration']++;
?>
								<tr>
						            <td><?php echo $this->_tpl_vars['v']['goods_id']; ?>
</td>
						            <td class="alig-center"><img src="./images/<?php echo $this->_tpl_vars['v']['goods_image']; ?>
" width="64" height="64" /></td>
						            <td><?php echo $this->_tpl_vars['v']['goods_name']; ?>
</td>
						            <td><?php echo $this->_tpl_vars['v']['goods_unitprice']; ?>
円</td>
						          <td class="update"><a href="javascript:CopyPath('<?php echo $this->_tpl_vars['v']['goods_name']; ?>
','<?php echo $this->_tpl_vars['v']['goods_id']; ?>
');">插入</a></td>
					             </tr>
								<?php endforeach; endif; unset($_from); ?>	
				</tbody>
			</table>

			<p class="pageNav">
				<?php echo $this->_tpl_vars['pageing']; ?>

			</p>
<?php endif; ?>
        </section>
</body>
</html>